//
//  WQNetTool.h
//  sanwuWeiboOC
//
//  Created by 王先强 on 15/12/8.
//  Copyright © 2015年 王先强. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
@class WQAccount;
typedef enum {
    WQHttpMethodTypeGET,
    WQHttpMethodTypePOST
} WQHttpMethodType;

@interface WQNetTool : AFHTTPSessionManager

@property (nonatomic, strong, readonly) NSURLRequest *oauthURLRequest;

+(instancetype)shareNetTool;

-(void)httpMethodType:(WQHttpMethodType)type prama:(NSDictionary *)prama urlString:(NSString *)urlString result:(void(^)(id success, NSError *error))result;
///  获取accessToken方法
///
///  @param code     授权码
///  @param finished 访问回调block
-(void)loadAccessTokenWithCode:(NSString *)code finishedBlock:(void(^)(id success, NSError *error))finished;
///  OAuth网络方法封装
///  @param accessToken     授权令牌
///  @param finished 访问回调block
-(void)loadUserInfoWithAccount:(WQAccount *)account finishedBlock:(void(^)(id success, NSError *failure))finished;

@end
